/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dataanalysis;

/**
 *
 * @author Administrator
 */
public class Flow {

    private int first = 1;
    private int second = 1;
    private int third = 1;

    public Flow() {
    }

    public Flow(int a, int b, int c) throws Exception {
        this.setValue(a, b, c);
    }

    public void setValue(int a, int b, int c) throws Exception {
        if (!firstInValues(a) || !secondInValues(b) || !thirdInValues(c)) {
            throw new Exception("not in value range!");
        } else {
            this.first = a;
            this.second = b;
            this.third = c;
        }
    }

    private boolean firstInValues(int a) {
        return a == 0 || a == 1;
    }

    private boolean secondInValues(int b) {
        return b == 0 || b == 1 || b == 2;
    }

    private boolean thirdInValues(int c) {
        return c == 0 || c == 1;
    }

    public boolean isPre() {
        return first == 1 ? true : false;
    }

    public boolean isSupAS() {
        return second == 1 ? true : false;
    }

    public boolean isSemiAS() {
        return second == 2 ? true : false;
    }

    public boolean isClassifier() {
        return third == 1 ? true : false;
    }
}
